/*
 * @Author: Evan-lian
 * @Date: 2023-12-25 17:11:12
 * @LastEditors: Evan-lian
 * @LastEditTime: 2023-12-28 17:46:28
 * @Description: 
 */
//为啥要这样写才不报错？
// import { createStore, combineReducers, applyMiddleware } from 'redux';  
// import auth from './auth/reducer'; 
// // const thunk = require('redux-thunk'); 
// import {thunk} from 'redux-thunk';  
// import logger from 'redux-logger';
// const { createStore, applyMiddleware ,combineReducers} = require('redux');  

  
// const rootReducer = combineReducers({  
//   auth: auth, // 指定一个键，例如 "auth"  
// });  

// const store = createStore(  
//   rootReducer,
//   applyMiddleware(thunk, logger)  
// );  
  
// export default store;

import auth from './auth/reducer'; 

import {createStore,applyMiddleware,compose,combineReducers} from 'redux'
import {thunk} from 'redux-thunk';
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : compose;

const enhancer = composeEnhancers(
	applyMiddleware(thunk),
);
const rootReducer = combineReducers({  
    auth, // 指定一个键，例如 "auth"  
  }); 
const store = createStore(rootReducer, enhancer)

export default store;
